<template>
	<view class="work_list">
		<view class="work_item" @click="navDetail(item.id)" v-for="item in works" :key="item.id">
			<image :src="'data:image/jpeg;base64,' + item.img"></image>
			<view class="price">
				<text>浏览：{{item.browsenum}}</text>
				<text>喜欢：{{item.likenum}}</text><br/>
				<text>作者：{{item.user_name}}</text>
			</view>
			<view class="work_name">
				{{item.title}}
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:['works'],
		methods:{
			navDetail(id){
				this.$emit("workItemClick",id);
			}
		}
	}
</script>

<style lang="scss">
	.work_list{
		background-color: #eee;
		padding: 0 15rpx;
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
		.work_item{
			background: #fff;
			width: 49%;
			margin: 10rpx 0;
			padding: 15rpx;
			box-sizing: border-box;
			image{
				height: 350rpx;
				width: 98%;
				display: block;
				margin: 0 auto;
			}
			.price{
				margin: 20rpx 0rpx;
				font-size: 30rpx;
				text:nth-child(2){
					// color: #ccc;
					// font-size: 28rpx;
					color: $shop-color;
					margin-left: 17rpx;
					// text-decoration:line-through ;
				}
			}
			.work_name{
				font-size: 36rpx;
				line-height: 50rpx;
				padding-top: 10rpx;
				padding-bottom: 15rpx;
			}
		}
	}
</style>
